Skip to content

fix(id): validate world manifest profile bounds and schedule count at parse time (#3015) - #4294

Merged
dezren39 merged 3 commits into
mainfrom
queue/5522-3015-manifest-bounds
Nov 2, 2026
Merged

dezren39 merged 3 commits into
mainfrom
queue/5522-3015-manifest-bounds

Conversation

@dezren39

@dezren39 dezren39 commented Nov 2, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #3015 (queue task 5522): WorldManifest::validate() never checked the requested execution profile or the pending-schedule count, so an invalid manifest parsed and planned clean, then failed partway through a live apply when WorldExecutionProfile::resolve() refused the bounds — after earlier apply steps may already have landed.

Change

  • pkgs/id/crates/id-core/src/world_limits.rs: the six bound checks (nonzero wasm_fuel / wasm_message_bytes / native_cpu_seconds / native_call_deadline_ms; wasm_memory_bytes ≥ 64 KiB; native_memory_bytes ≥ 16 MiB) are extracted from resolve() into a new WorldExecutionProfile::validate(); resolve() calls it. One source of truth, so parse-time and apply-time enforcement cannot drift again.
  • pkgs/id/src/world_manifest.rs: WorldManifest::validate() now runs profile.validate() and refuses a schedules map longer than MAX_PENDING_SCHEDULES (64).

Out of scope per the packet: schedule-horizon validation, unknown-key handling (#2876), module_hash docs (#2166), and any change to the limits themselves.

Tests

New parse-level regression tests in world_manifest.rs: each of the six invalid bounds is rejected by parse(); the boundary-valid minima (64 KiB Wasm memory, 16 MiB native memory) are accepted; a 64-entry schedules map is accepted and a 65-entry map is rejected naming the cap. Verification runs in CI per fleet policy (no local build — laptop load is fleet-contended this shift).

… parse time (#3015)

WorldManifest::validate() never checked the requested execution profile
or the number of pending schedules, so a manifest could parse and plan
clean, then fail partway through a live apply when resolve() refused
the bounds.

- Extract the six bound checks from WorldExecutionProfile::resolve()
  into WorldExecutionProfile::validate() in id-core; resolve() calls
  it, so apply-time and parse-time enforcement can never drift.
- WorldManifest::validate() now runs profile.validate() and refuses a
  schedules map longer than MAX_PENDING_SCHEDULES (64).
- Parse-level regression tests: each invalid bound rejected, the
  boundary-valid minima (64 KiB Wasm / 16 MiB native) accepted, 64
  schedules accepted and 65 rejected.
@dezren39
dezren39 requested a review from a team as a code owner November 2, 2026 09:04
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39333962-f98a-4472-aab0-bfe215b68250
Commits

Reviewing files that changed from the base of the PR and between cc819fe and 25c17ef.

Files selected for processing: 2
  • pkgs/id/crates/id-core/src/world_limits.rs
  • pkgs/id/src/world_manifest.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T12:13:11.294536Z 25c17ef Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The schedule_count_is_capped_at_parse test built its entries with an unescaped quote (format!(""s{i}" = ...")), so the id lib test target did not compile: cargo error at world_manifest.rs:594, expected comma, found {. CI on PR #4294 has been QUEUED since 2026-11-02T09:04Z and never caught it; found by running the targeted tests on the laptop this shift. Escape the quotes. Targeted tests now pass: cargo test --manifest-path pkgs/id/Cargo.toml --lib world_manifest::tests — 17 passed.
@dezren39

dezren39 commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review — new head 2229123 fixes a compile error in the new schedule-count test (unescaped quotes in a format string) found by laptop targeted tests; the diff otherwise unchanged. Please re-review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2229123888

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkgs/id/src/world_manifest.rs Outdated
}

#[test]
fn invalid_profile_bounds_are_rejected() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Prefix the new test functions with test_

The scoped naming rule in pkgs/id/AGENTS.md explicitly requires test functions to use the test_ prefix. All three newly added tests—invalid_profile_bounds_are_rejected, minimum_profile_bounds_are_accepted, and schedule_count_is_capped_at_parse—omit it. Rename these functions to comply with the documented repository convention.

AGENTS.md reference: pkgs/id/AGENTS.md:L140-L140

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 25c17ef: all three new tests renamed with the test_ prefix per pkgs/id/AGENTS.md (test_invalid_profile_bounds_are_rejected, test_minimum_profile_bounds_are_accepted, test_schedule_count_is_capped_at_parse). Targeted tests re-run on the laptop after the rename: cargo test --manifest-path pkgs/id/Cargo.toml --lib world_manifest::tests — 17 passed.

Codex P1 on PR #4294 (head 2229123): pkgs/id/AGENTS.md requires test_ prefix for test functions. Rename test_invalid_profile_bounds_are_rejected, test_minimum_profile_bounds_are_accepted, test_schedule_count_is_capped_at_parse accordingly. Targeted tests re-run on laptop: 17 passed.
@dezren39

dezren39 commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review — head 25c17ef renames the three new tests with the test_ prefix (your P1, replied on its thread); targeted laptop tests 17/17 pass on this head. Please re-review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 25c17efa5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dezren39
dezren39 merged commit f12f5b7 into main Nov 2, 2026
1 check passed
@dezren39
dezren39 deleted the queue/5522-3015-manifest-bounds branch November 2, 2026 12:14
@dezren39
dezren39 restored the queue/5522-3015-manifest-bounds branch November 8, 2026 04:18
@dezren39
dezren39 deleted the queue/5522-3015-manifest-bounds branch November 9, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant